forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 351
🍒[DebugInfo] Cherry-pick Objective-C property debug-info changes to stable/21.x #11757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…LVM IR (llvm#165286) There's a couple of tests like this. This patch series renames these to something more descriptive and adjusts the tests to check IR. Currently the tests check raw assembly output (not even dwarfdump). Which most likely hid some bugs around property debug-info. (cherry picked from commit cc868f6)
Changes test name to something more meaningful. In preparation to refactoring the test to check LLVM IR instead of assembly. (cherry picked from commit 267b5b8)
Check for lack of `setter` and `getter` attributes on `DIObjCProperty` (cherry picked from commit 7694817)
…lvm#165298) We already have the same test (just different variable names) in `property-basic.m`. (cherry picked from commit e44dce3)
…k LLVM IR (llvm#165297) This patch series renames these Objective-C property tests to something more descriptive and adjusts them to check IR. Currently the tests check raw assembly output (not even dwarfdump). Which most likely hid some bugs around property debug-info. (cherry picked from commit 5d9df8f)
New name makes it easer to find and checking IR is less likely to hide bugs (and is more consistent with the other Clang debug-info tests). (cherry picked from commit d0a7411)
…-info (llvm#165373) The IR->DWARF pipeline was not properly tested before. This patch adds a test to generate DWARF for various `DIObjCProperty` constructions. This caught a couple of bugs: 1. The `DW_AT_APPLE_property_getter` and `DW_AT_APPLE_property_setter` properties were emitted the wrong way around. 2. The `DW_TAG_member` ivars were not linking back to the property that they back. These will be fixed in follow-up patches. (cherry picked from commit 7fb6fae)
…Property constructor (llvm#165401) Depends on: * llvm#165373 This caused the `DW_AT_APPLE_property_(setter|getter)` to be inverted when compiling from LLVM IR. (cherry picked from commit dda95d9)
Fails with: ``` ******************** TEST 'LLVM :: DebugInfo/Generic/objc-property.ll' FAILED ******************** Exit Code: 2 Command Output (stdout): -- RUN: at line 1 ome/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/bin/llc -filetype=obj -o - /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/test/DebugInfo/Generic/objc-property.ll | /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/bin/llvm-dwarfdump --debug-info - | /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/bin/FileCheck /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/test/DebugInfo/Generic/objc-property.ll executed command: /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/bin/llc -filetype=obj -o - /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/test/DebugInfo/Generic/objc-property.ll .---command stderr------------ | Assertion failed: Section && "Cannot switch to a null section!", file /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/lib/MC/MCStreamer.cpp, line 1364, virtual void llvm::MCStreamer::switchSection(MCSection *, uint32_t)() | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug. | Stack dump: | 0. Program arguments: /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/bin/llc -filetype=obj -o - /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/test/DebugInfo/Generic/objc-property.ll `----------------------------- error: command failed with exit status: -6 executed command: /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/bin/llvm-dwarfdump --debug-info - .---command stderr------------ | error: -: The file was not recognized as a valid object file `----------------------------- error: command failed with exit status: 1 executed command: /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/bin/FileCheck /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/test/DebugInfo/Generic/objc-property.ll .---command stderr------------ | FileCheck error: '<stdin>' is empty. | FileCheck command line: /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/bin/FileCheck /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/test/DebugInfo/Generic/objc-property.ll `----------------------------- error: command failed with exit status: 2 ``` Presumably due to unsupported debug-info section (see llvm#71814) (cherry picked from commit 31180ba)
…operty constructor (llvm#165421) Depends on: * llvm#165401 We weren't testing `DIObjCProperty` roundtripping. So this was never caught. The consequence of this is that the `setter:` would have the getter name and `getter:` would have the setter name. (cherry picked from commit 49f918d)
…#165537) This patch makes `dwarfdump` show the `DW_AT_APPLE_property_name` of a referenced `DW_TAG_APPLE_property` (similar to how we show the name of a referenced `DW_AT_type`). Eventually we'll extend this to the DWARFv6 property tags too. Before: ``` 0x00000013: DW_TAG_APPLE_property DW_AT_APPLE_property_name ("propertyName") 0x0000001b: DW_TAG_member DW_AT_name ("_ivar") DW_AT_APPLE_property (0x00000013) ``` After: ``` 0x00000013: DW_TAG_APPLE_property DW_AT_APPLE_property_name ("propertyName") 0x0000001b: DW_TAG_member DW_AT_name ("_ivar") DW_AT_APPLE_property (0x00000013 "propertyName") ``` (cherry picked from commit 1e7c082)
…AG_APPLE_property (llvm#165409) Depends on: * llvm#165373 When an Objective-C property has a backing ivar, we would previously not add a `DW_AT_APPLE_property` to the ivar's `DW_TAG_member`. This is what was intended based on the [Objective-C DebugInfo docs](https://github.com/llvm/llvm-project/blob/main/llvm/docs/SourceLevelDebugging.rst#proposal) but is not what LLVM currently generates. LLDB currently doesn't ever try linking the `ObjCPropertyDecl`s to their `ObjCIvarDecl`s, but if we wanted to, this debug-info patch is a pre-requisite. (cherry picked from commit 10fbbb6)
|
@swift-ci test |
|
@swift-ci test llvm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.